package com.dmzc.stage2.chapter21;


public class ActionContext {
    /**
     * 可以将所有线程相关的信息封装在context中，也可以设定多个ThreadLocal
     */
    private static  final ThreadLocal<Context>context
            =ThreadLocal.withInitial(Context::new);
    public static Context get(){
        return context.get();
    }
    static class Context{
        private int intA;
        private String intB;

        public void setIntA(int intA) {
            this.intA = intA;
        }

        public void setIntB(String intB) {
            this.intB = intB;
        }

        public int getIntA() {
            return intA;
        }

        public String getIntB() {
            return intB;
        }
    }
}
